# get this script file path
if [ ${BASH_SOURCE[0]%%/*} ];# the first char not '/'
then EASY_FILE_PATH=`pwd`/${BASH_SOURCE[0]};
else EASY_FILE_PATH=${BASH_SOURCE[0]};
fi
EASY_FILE_PATH=${EASY_FILE_PATH%/*}

# **01** prerequisite prepare
if [ -e ${EASY_FILE_PATH}/../prerequisite.sh ]; then
	echo \[\#\| HEAD \] PREREQUISITE \>\- %{EASY_FILE_PATH}/../prerequisite.sh;
	bash ${EASY_FILE_PATH}/../prerequisite.sh;
	echo \[\#\| TAIL \] PREREQUISITE \>\- %{EASY_FILE_PATH}/../prerequisite.sh;
fi

# **02** prepare for make
echo :\\____/:
echo preparing
cat ${EASY_FILE_PATH}/config_part1.mk ${EASY_FILE_PATH}/../config_local.mk ${EASY_FILE_PATH}/config_part2.mk > ${EASY_FILE_PATH}/config_joint.mk
if [ -e ${EASY_FILE_PATH}/avoidremake ];then rm -f ${EASY_FILE_PATH}/avoidremake;fi

# **03** make
make -f ${EASY_FILE_PATH}/config_joint.mk $@